package com.example.pm.ending.server.service.impl;

import com.example.pm.ending.server.mapper.HouseMapper;
import com.example.pm.ending.server.pojo.dto.HouseAddDTO;
import com.example.pm.ending.server.pojo.entity.House;
import com.example.pm.ending.server.pojo.vo.HouseListVO;
import com.example.pm.ending.server.service.IHouseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author JJS
 */
@Slf4j
@Service
public class HouseServiceImpl implements IHouseService {

    @Autowired private HouseMapper houseMapper;
    @Override
    public void addNew(HouseAddDTO houseAddDTO) {
        House house = new House();
        BeanUtils.copyProperties(houseAddDTO,house);
        houseMapper.insert(house);
        log.info("插入数据{}",house);
    }

    @Override
    public List<HouseListVO> list() {
        houseMapper.list();
        return null;
    }
}
